package com.region.integral.util;

import java.text.MessageFormat;
import java.util.Date;

import com.region.integral.common_user.pojo.CommonLogEntity;

public class CommonUserLogUtil {
	static {
		PropertiesLogerUtil.load(CommonUserLogUtil.class.getResourceAsStream("/"+LoadResourcesUtil.getResource(IntegralConstants.COMMON_USER_LOG)));
	}
	public static CommonLogEntity log(int userid,int integral,String event){
		String describe = MessageFormat.format(PropertiesLogerUtil.getRuleIntegral(event), userid,event,integral);
		CommonLogEntity clenEntity = new CommonLogEntity();
		clenEntity.setUserid(userid);
		clenEntity.setRecordDate(new Date());
		clenEntity.setEvent(event);
		clenEntity.setDescribe(describe);
		return clenEntity;
	}
}
